import React from 'react'
import {
	StyleSheet,
	Image
} from 'react-native'
import {
	StackNavigator
} from 'react-navigation'

import * as publicParams from './public'

//工具类
const ToosTabs = StackNavigator({
	List: {
		screen: publicParams.CommentScreen, //createContainer
		navigationOptions: ({
			navigation
		}) => ({
			headerTitle: '视频列表',
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16
			}
		})
	},
	Detail: {
		screen: publicParams.DetailScreen,
		navigationOptions: ({
			navigation
		}) => ({
			title: `${navigation.state.params.name}详情页`,
			headerStyle: styles.headerStyle,
			headerTintColor: '#fff',
			tabBarVisible: false,
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16,
			}
		})
	},
	Comment: {
		screen: publicParams.CommentScreen,
		navigationOptions: ({
			navigation
		}) => ({
			title: `${navigation.state.params.name}列表页`,
			headerStyle: styles.headerStyle,
			headerTintColor: '#fff',
			tabBarVisible: false,
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16,
			}
		})
	},

})
ToosTabs.navigationOptions = {
	title: '工具',
	tabBarLabel: '工具',
	tabBarIcon: ({
		tintColor,
		focused
	}) => (
		<Image
        source={focused ? require('../../static/Image/shezhi.png') : require('../../static/Image/shezhi.png')}
        style={[styles.icon, {tintColor: tintColor}]}
      />
	),
}

const styles = StyleSheet.create({
	icon: {
		width: 26,
		height: 26,
	},
	headerStyle: {
		height: 52,
		paddingTop: 14,
		backgroundColor: '#e62e4c',
	}
});
export default ToosTabs;